<template>
    <div>
      <van-nav-bar
    title="ta的信息"
    left-text="返回"
    left-arrow
    @click-left="$router.go(-1)"
  />
  
  <div class="HeadEdit"><img :src=userInfo.userAvatar alt=""></div>
        
        <van-field readonly  v-model="userInfo.userNickname" label="昵称：" />
        <van-field readonly  v-model="userInfo.userGender" label="性别：" />
        <van-field readonly  v-model="userInfo.userMajor" label="专业：" />
        <van-field readonly  v-model="userInfo.userLocation" label="地区：" />
  
    </div>
  </template>
  
  <script>
  import {lookXinxi} from '@/api/user' 
  export default {
  name:"xinxi",
  data() {
    return {
      receivedParam1: '',//这个帖子的id
      userInfo: '' // 保存用户信息的变量
    }
  },
  mounted() {
    this.receivedParam1 = this.$route.params.param1;
    // console.log('收到的信息', this.receivedParam1);
    lookXinxi( this.receivedParam1)
    .then((res)=>{
      console.log(res.data);
        this.userInfo = res.data;
    })
  },
  // 查询用户信息
  // created() {
  //   console.log(111, this.receivedParam1);
  //   lookXinxi( this.receivedParam1)
  //   .then((res)=>{
  //       this.userInfo = res.data;
  //   })
  //   },
  methods:{

  }
}
  </script>
  
  <style lang="less" scoped>
  .van-nav-bar__text{
    color: black;
  }
   .HeadEdit{
    width: 100%;
    img{
      width: 100px;
      height: 100px;
      margin-left: 138px;
      margin-top: 40px;
      border-radius: 100px;
    }
   }
   .van-button--primary{
    width: 28.66667vw;
    background-color: #0a87f5;
    font-size: 1.66667vw;
    height: 30px;
    border-radius: 20px;
    margin-top: 10px;
    border: 0;
   }
  .van-field__control{
    margin-top: -3px;
  }
  </style>